//
//  CityCellOfSilkbag.m
//  FreeTravel
//
//  Created by 徐康 on 16/9/5.
//  Copyright © 2016年 KX. All rights reserved.
//
#import "Masonry.h"
#import "CityCellOfSilkbag.h"
@interface CityCellOfSilkbag ()
@property (nonatomic, strong) UILabel *labelOfCnname;
@property (nonatomic, strong) UILabel *labelOfGuide_num;
@property (nonatomic, strong) UIImageView *imageViewOfArrow;

@property (nonatomic, strong) UIView *grayBlock;
@end
@implementation CityCellOfSilkbag
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.labelOfCnname = [[UILabel alloc]init];
        self.labelOfGuide_num = [[UILabel alloc]init];
        self.imageViewOfArrow = [[UIImageView alloc]init];

        self.grayBlock = [[UIView alloc]init];
        [self.contentView addSubview:self.grayBlock];

        [self.contentView addSubview:self.labelOfCnname];
        [self.contentView addSubview:self.labelOfGuide_num];
        [self.contentView addSubview:self.imageViewOfArrow];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.imageViewOfArrow.image = [UIImage imageNamed:@"xiangyouhui"];
    [self.imageViewOfArrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).mas_offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).mas_offset(-15);
        make.right.equalTo(self.contentView.mas_right).mas_offset(-10);
        make.width.mas_equalTo(25);
    }];
    [self.labelOfCnname mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(150);
        make.left.equalTo(self.contentView.mas_left).mas_offset(20);
        make.top.equalTo(self.contentView.mas_top).mas_offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).mas_offset(-15);
    }];
    [self.labelOfGuide_num mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(100);
        make.top.equalTo(self.contentView.mas_top).mas_offset(10);
        make.bottom.equalTo(self.contentView.mas_bottom).mas_offset(-15);
        make.right.equalTo(self.imageViewOfArrow.mas_left);
    }];
    self.labelOfGuide_num.textAlignment = NSTextAlignmentCenter;
    self.labelOfGuide_num.font = [UIFont systemFontOfSize:12];
    self.labelOfGuide_num.textColor = [UIColor grayColor];

    
    [self.grayBlock mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.contentView);
        make.height.mas_offset(4);
    }];
    self.grayBlock.backgroundColor = [UIColor lightGrayColor];

}
- (void)setModel:(ModelOfDataCommendScenicSpotView *)model{
    _model = model;
    self.labelOfCnname.text = [NSString stringWithFormat:@"%@锦囊",self.model.cnname];
    self.labelOfGuide_num.text = [NSString stringWithFormat:@"全部%ld本",self.model.guide_num];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
